import React, { render, Component } from './react'

const root = document.getElementById('root')

// const jsx = (
// <p>
//   <span>Hello React</span>
//   <span>Hello Fiber</span>
// </p>
// )

// render(jsx, root)

// setTimeout(() => {
//   const jsx = (
//     <p>
//       <span>Fiber is awesome</span>
//     </p>
//   )
//   render(jsx, root)
// }, 2000)

class Creating extends Component {
  constructor (props) {
    super(props)
    this.state = {
      name: '张三'
    }
  }
  render () {
    return <div>{this.state.name}<button onClick={() => this.setState({name: "李四"})}>button</button></div>
  }
}

render(<Creating title="wula"/>, root)

// function FnComponent (props) {
//   return <div>{props.title}FnComponent</div>
// }

// // render(<FnComponent title="hello"/>, root)